package com.wangshouyu.mp.user.tag;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.SerializedName;

import java.io.Serializable;
import java.util.List;
import java.util.Objects;

/**
 * @author 王守钰
 * @date 2020年12月23日 15:37
 * @description 用户标签
 */
public class TagUserRequest implements Serializable {

    /**
     * 标签id
     */
    @SerializedName(value = "tagid")
    @JsonProperty(value = "tagid")
    @JSONField(name = "tagid")
    private Long tagId;

    /**
     * 第一个拉取的OPENID，不填默认从头开始拉取
     */
    @SerializedName(value = "next_openid")
    @JsonProperty(value = "next_openid")
    @JSONField(name = "next_openid")
    private String nextOpenId;

    /**
     * 粉丝列表
     */
    @SerializedName(value = "openid_list")
    @JsonProperty(value = "openid_list")
    @JSONField(name = "openid_list")
    private List<String> openIdList;

    public Long getTagId() {
        return tagId;
    }

    public void setTagId(Long tagId) {
        this.tagId = tagId;
    }

    public String getNextOpenId() {
        return nextOpenId;
    }

    public void setNextOpenId(String nextOpenId) {
        this.nextOpenId = nextOpenId;
    }

    public List<String> getOpenIdList() {
        return openIdList;
    }

    public void setOpenIdList(List<String> openIdList) {
        this.openIdList = openIdList;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        TagUserRequest tagUser = (TagUserRequest) o;
        return Objects.equals(tagId, tagUser.tagId) && Objects.equals(nextOpenId, tagUser.nextOpenId) && Objects.equals(openIdList, tagUser.openIdList);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), tagId, nextOpenId, openIdList);
    }

    @Override
    public String toString() {
        return "TagUser{" +
                "tagId=" + tagId +
                ", nextOpenId='" + nextOpenId + '\'' +
                ", openIdList=" + openIdList +
                '}';
    }

    public TagUserRequest(Long tagId, String nextOpenId) {
        this.tagId = tagId;
        this.nextOpenId = nextOpenId;
    }

    public TagUserRequest(Long tagId, List<String> openIdList) {
        this.tagId = tagId;
        this.openIdList = openIdList;
    }

    public TagUserRequest() {
    }
}
